<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Someclass extends CI_Controller
{
    
    public function __construct()
	{
       parent::__construct();
    }  
 
    function view($page = ''){
       if($member_page = file_exists(APPPATH . 'views/members/' . $page . '.php')){        
          $data['main_content'] =   'members/'.$page;
          $this->load->view('includes/template', $data);
        }else{
           // Call our custom 404 function
           show_404();
        }
    }
}

class custom404 extends CI_Controller 
{
    public function __construct() 
    {
        parent::__construct(); 
    } 

    public function index() 
    { 
        $this->output->set_status_header('404'); 
        $data['content'] = 'custom_404_view'; 		// View name 
        $this->load->view('index',$data); 			//loading in my template 
		//
		/*
		$data['title'] = 'Error 404 - Not Found';
		$this->load->view('templates/header', $data);
		$this->load->view('registration/index', $data);
		$this->load->view('templates/footer', $data);
		*/
    } 
} 
